package com.yf.exam.modules.trainingarchives.trainingassessmentreport.service.impl;

import com.yf.exam.modules.trainingarchives.pdfexport.dto.second.TrainingAssessmentReportExportDTO;
import com.yf.exam.modules.trainingarchives.trainingassessmentreport.dto.TrainingAssessmentReportDTO;
import com.yf.exam.modules.trainingarchives.trainingassessmentreport.entity.TrainingAssessmentReport;
import com.yf.exam.modules.trainingarchives.trainingassessmentreport.mapper.TrainingAssessmentReportMapper;
import com.yf.exam.modules.trainingarchives.trainingassessmentreport.service.ITrainingAssessmentReportService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 综合考评报告表 服务实现类
 * </p>
 *
 * @author author
 * @since 2024-12-29
 */
@Service
public class TrainingAssessmentReportServiceImpl extends ServiceImpl<TrainingAssessmentReportMapper, TrainingAssessmentReport> implements ITrainingAssessmentReportService {

    @Override
    public void add(TrainingAssessmentReportDTO reqDTO) {
        TrainingAssessmentReport entity = new TrainingAssessmentReport();
        BeanUtils.copyProperties(reqDTO,entity);
        this.saveOrUpdate(entity);
    }

    @Override
    public TrainingAssessmentReportExportDTO getTrainingAssessmentReporPdfData(String trainingClassInfoId) {
        return baseMapper.getTrainingAssessmentReporPdfData(trainingClassInfoId);
    }

}
